package com.yunyun400.vosk.entity;

import java.util.Date;
import java.util.List;

/**
 * 提醒记录实体类
 * 用于存储检测到关键词"resume"的录音文件信息
 */
public class ReminderRecord {
    
    private String id;              // 记录ID
    private String recordingFilePath; // 录音文件路径
    private String recordingFileName; // 录音文件名
    private Date detectionTime;     // 检测时间
    private String recognizedText;  // 识别的文本内容（可选，存储部分内容）
    private String batchId;         // 关联的外呼批次ID
    private boolean isProcessed;    // 是否已处理
    private List<String> records;
    
    // 构造函数
    public ReminderRecord() {
        this.detectionTime = new Date();
        this.isProcessed = false;
    }
    
    public ReminderRecord(String recordingFilePath) {
        this();
        this.recordingFilePath = recordingFilePath;
        // 从文件路径中提取文件名
        if (recordingFilePath != null) {
            int lastSeparatorIndex = recordingFilePath.lastIndexOf("/");
            if (lastSeparatorIndex == -1) {
                lastSeparatorIndex = recordingFilePath.lastIndexOf("\\");
            }
            if (lastSeparatorIndex != -1) {
                this.recordingFileName = recordingFilePath.substring(lastSeparatorIndex + 1);
            } else {
                this.recordingFileName = recordingFilePath;
            }
        }
    }
    
    // Getters and Setters
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    public String getRecordingFilePath() {
        return recordingFilePath;
    }
    
    public void setRecordingFilePath(String recordingFilePath) {
        this.recordingFilePath = recordingFilePath;
    }
    
    public String getRecordingFileName() {
        return recordingFileName;
    }
    
    public void setRecordingFileName(String recordingFileName) {
        this.recordingFileName = recordingFileName;
    }
    
    public Date getDetectionTime() {
        return detectionTime;
    }
    
    public void setDetectionTime(Date detectionTime) {
        this.detectionTime = detectionTime;
    }
    
    public String getRecognizedText() {
        return recognizedText;
    }
    
    public void setRecognizedText(String recognizedText) {
        this.recognizedText = recognizedText;
    }
    
    public String getBatchId() {
        return batchId;
    }
    
    public void setBatchId(String batchId) {
        this.batchId = batchId;
    }
    
    public boolean isProcessed() {
        return isProcessed;
    }
    
    public void setProcessed(boolean isProcessed) {
        this.isProcessed = isProcessed;
    }
    
    
    
    public List<String> getRecords() {
		return records;
	}

	public void setRecords(List<String> records) {
		this.records = records;
	}

	@Override
	public String toString() {
		return "ReminderRecord [id=" + id + ", recordingFilePath=" + recordingFilePath + ", recordingFileName="
				+ recordingFileName + ", detectionTime=" + detectionTime + ", recognizedText=" + recognizedText
				+ ", batchId=" + batchId + ", isProcessed=" + isProcessed + ", records=" + records + "]";
	}

	
}